//
//  MoneyHistoryCell.m
//  huien
//
//  Created by lcb on 2017/7/18.
//  Copyright © 2017年 lcb. All rights reserved.
//

#import "MoneyHistoryCell.h"
@interface MoneyHistoryCell ()
{
    
}
@property(nonatomic,strong)UIImageView *iconView;
@property(nonatomic,strong)UILabel *keyLab;
@property(nonatomic,strong)UILabel *ValueLab;
@property(nonatomic,strong)UILabel *unitLab;
@property(nonatomic,strong)UIImageView *statusView;
@end
@implementation MoneyHistoryCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
}
/// 根据数据模型来显示内容
- (void)showInfo:(id)model indexPath:(NSIndexPath *)indexPath
{
    self.data =model;
    self.indexPath=indexPath;
    FundsModel *info = (FundsModel*)model;
    
    self.keyLab.frame =CGRectMake(10, 10, SCREEN_WIDTH/3, 20);
    self.keyLab.text = info.name;
    
    self.ValueLab.frame =CGRectMake(self.keyLab.frame.origin.x+self.keyLab.frame.size.width+10, 10, SCREEN_WIDTH/3, 20);
    self.ValueLab.text = info.money;
    
    self.unitLab.frame =CGRectMake(SCREEN_WIDTH-30, 10, 20, 20);
    self.unitLab.text = info.unit;
    
}
+(CGFloat)returnCellHeight
{
    return 40;
}
-(void)dealloc
{
    [LcbLog log:@"UserInfoTableViewCell--------->dealloc"];
}
-(UILabel*)keyLab
{
    if (!_keyLab) {
        _keyLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 20)];
        _keyLab.font = [UIFont systemFontOfSize:15];
        _keyLab.textColor = h1color;
        _keyLab.textAlignment = NSTextAlignmentLeft;
        _keyLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_keyLab];
    }
    return _keyLab;
}
-(UILabel*)ValueLab
{
    if (!_ValueLab) {
        _ValueLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 20)];
        _ValueLab.font = [UIFont systemFontOfSize:15];
        _ValueLab.textColor = [UIColor redColor];
        _ValueLab.textAlignment = NSTextAlignmentLeft;
        _ValueLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_ValueLab];
    }
    return _ValueLab;
}
-(UILabel*)unitLab
{
    if (!_unitLab) {
        _unitLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 20)];
        _unitLab.font = [UIFont systemFontOfSize:15];
        _unitLab.textColor = h1color;
        _unitLab.textAlignment = NSTextAlignmentLeft;
        _unitLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_unitLab];
    }
    return _unitLab;
}
@end
